/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package vn.ac.aptech.fat1.c0910g.dao;

import java.util.ArrayList;
import vn.ac.aptech.fat1.c0910g.entity.Food;

/**
 *
 * @author NDC
 */
public interface FoodDAO {
    /**
     *  Add new food to database. 
     *  @param f The object contain information of food
     *  @return true if add successfully or false if not
     *  @throws Throws Exception if have any error.
     */
    public boolean addFood(Food f) throws Exception;

    /**
     *  Update the food informations to database.
     *  Update food which the ID of food.
     *  @param f The object contain information of food. (Must have older ID)
     *  @return true if update successfully or false if not
     *  @throws Throws Exception if have any error.
     */
    public boolean updateFood(Food f) throws Exception;

    /**
     *  Delete the food which have fid in database.
     *  @param f The object food must have ID
     *  @return true if delete successfully or false if not
     *  @throws Throws Exception if have any error.
     */
    public boolean deleteFood(Food f) throws Exception;
    
    /**
     *  Get the food which have fid in database.
     *  @param fid The ID of food.
     *  @return the object of Food if have information in database.
     *  Return null if no Food found
     *  @throws Throws Exception if have any error.
     */
    public Food getFoodById(int fid) throws Exception;

    /**
     *  List all foods from database.
     *  @return the list of Foods.
     *  Return null if no Food found
     *  @throws Throws Exception if have any error.
     */
    public ArrayList<Food> listFoods() throws Exception;
}
